package main

import (
	"io"
	"net/http"
)

/** http/net/server.go */

func main() {
	r := http.NewServeMux()
	r.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {
		read, err := io.ReadAll(r.Body)
		defer r.Body.Close()
		if err != nil {
			println(err.Error())
			return
		}
		println(string(read))
		w.Write([]byte("success"))
	})
	http.ListenAndServe("0.0.0.0:8000", r)
}
